/*
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

Find the sum of all the primes below two million.*/
class EulerProblem10 {

    boolean isItPrime(int possiblePrimeNumber){
        for(int i=2;i<=Math.sqrt(possiblePrimeNumber);i++){
            if(possiblePrimeNumber%i ==0){
                return false;
            }
            
        }
        return true;
    }
    long sumFinder(int primeNumberLimit){
        long sum=0;
        for(int i=2;i<=primeNumberLimit;i++){
            if(isItPrime(i)){
                 System.out.println(i);
                sum += i;
            }
        }
        System.out.println(sum);
        return sum;
    }

    public static void main(String []arg){
       System.out.println(new EulerProblem10().sumFinder(2000000));
    }
}
